﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ChangePassword : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!isLogin())
            {
                Response.Redirect("~/Index.aspx");
            }
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DALCustomer c = new DALCustomer();
        tblCustomer customer1 = null;
        Hash cipher = new Hash();
        if (isLogin())
        {
            if (TextBox1.Text == TextBox2.Text)
            {
                customer1 = LoginedMember;
                customer1.Password = cipher.hash(TextBox1.Text);
                c.updateCustomer(customer1);
                Label3.Text = "Password Successfully Changed";
            }
            else
            {
                Label3.Text = "Un-Matched password, please check again";
            }

        }
       
    }
}